package com.lm.xstream.example;

import com.lm.xstream.ele.Person;
import com.thoughtworks.xstream.XStream;

public class XStreamExample {
    public static void main(String[] args) {
        XStream xstream = new XStream();
        xstream.processAnnotations(Person.class); // 启用注解处理

        // 创建对象
        Person person = new Person("John", 30);

        // 对象转 XML
        String xml = xstream.toXML(person);
        System.out.println(xml);
    }
}
